function confirmOrder() {

    var Request = new Object();
    Request = GetRequest();
    var order=getRequest();
    var seatArray=order["seatArray"];
    var placeId=order["placeId"];
    var commdityId=order["commdityId"];
    var schedulerId=order["schedulerId"];
    var skuId=order["skuId"];
    var money=order["money"];
    yhj=0;
    var ticketDrawer=$("#ticketDrawer").val(); //取票人
    var contactNumber=$("#contactNumber").val(); //联系人方式

    alert(ticketDrawer+"=====");
    alert("创建订单");
    $.ajax({
        headers:{
            token:getCookie("token")
        },
        url:'http://cn.pn.com/api-pn/order/api/v/createOrder',
        data:{
            skuId:skuId,
            itemId:commdityId,
            deliverType:deliverType,
            seatPositions:seatArray,
            placeId:placeId,
            schedulerId:schedulerId,
            ticketDrawer:ticketDrawer,
            contactNumber:contactNumber,
            yhj:yhj
        },
        dataType:"json",
        async:false,
        type: 'post',
        success:function (dataSource) {
            alert("下单返回是否成功："+dataSource.success);
            if(dataSource.success == "false"){
                if(dataSource.errorCode == "3001"){
                    alert("你手太残废，座位已经被抢了！！！")
                }else{
                    alert(dataSource.msg);
                }
            }

            if(dataSource.success == "true"){
                alert("下单成功1");
                alert("orderNum="+dataSource.data.orderNum+",totalAmount"+dataSource.data.totalAmount+",commodityName"+dataSource.data.commodityName+",deliverType"+dataSource.data.deliverType+",ticketDrawer"+dataSource.data.ticketDrawer+",contactNumber"+dataSource.data.contactNumber);
                $.StandardPost('Offer.html',{orderNum:dataSource.data.orderNum,totalAmount:dataSource.data.totalAmount,commodityName:dataSource.data.commodityName,deliverType:dataSource.data.deliverType,ticketDrawer:dataSource.data.ticketDrawer,contactNumber:dataSource.data.contactNumber});
            }
        },
        error: function (response) {
            console.log(response);
            alert("执行异常!");
        }
    });
}





$.extend({
    StandardPost:function(url,args){
        var form = $("<form method='get'></form>");
        //jquery方式
        //$(document.body).append(form);
        //js原生添加
        //document.body.appendChild(form);
        form.attr({"action":url});
        $.each(args,function(key,value){
            var input = $("<input type='hidden'>");
            input.attr({"name":key});
            input.val(value);
            form.append(input);
        });
        $("html").append(form);
        console.log(args);
        form.submit();
    }

});

function GetRequest() {
    var url = window.location.search; //获取url中"?"符后的字串
    url=url.replace("%-%","?");
    url=url.replace("equals","=");
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            //就是这句的问题
            theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}


/*alert(下单正确返回);
alert(dataSource.data);
alert(msg+dataSource.msg);
alert(errorCode+dataSource.errorCode);
alert(success+dataSource.success);*/